diff options
| author | jackyzha0 <[email protected]> | 2021-04-11 13:50:20 -0700 |
|---|---|---|
| committer | jackyzha0 <[email protected]> | 2021-04-11 13:50:20 -0700 |
| commit | d58c7a3ad5dc83a08e040a855f158f8c6c09e154 (patch) | |
| tree | ec2f295f0816858915702c1f4e67973c2e4976fa /frontend/src/pages/raw/[hash].js | |
| parent | refactor error handling in pasteinfo (diff) | |
| download | ctrl-v-d58c7a3ad5dc83a08e040a855f158f8c6c09e154.tar.xz ctrl-v-d58c7a3ad5dc83a08e040a855f158f8c6c09e154.zip | |
password resolution, dynamic head
Diffstat (limited to 'frontend/src/pages/raw/[hash].js')
| -rw-r--r-- | frontend/src/pages/raw/[hash].js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/frontend/src/pages/raw/[hash].js b/frontend/src/pages/raw/[hash].js index a100b4b..3374eea 100644 --- a/frontend/src/pages/raw/[hash].js +++ b/frontend/src/pages/raw/[hash].js @@ -2,6 +2,7 @@ import React from 'react'; import resolvePaste from "../../http/resolvePaste"; import {CodeLike} from "../../components/Common/mixins"; import styled from 'styled-components' +import NextHead from "../../components/NextHead"; const RawText = styled.pre` ${CodeLike} @@ -10,15 +11,17 @@ const RawText = styled.pre` export async function getServerSideProps(ctx) { const data = await resolvePaste(ctx.params.hash) - - // Pass data to the page via props + console.log(data) return { props: { ...data } } } const Raw = ({error, data}) => { - return <RawText> - {data?.content || error} - </RawText> + return <> + {!error && <NextHead data={data} />} + <RawText> + {data?.content || error} + </RawText> + </> } export default Raw
\ No newline at end of file |